//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ybear.ybcomponent;

import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.Gravity;

import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;

import com.ybear.ybcomponent.widget.RedDotLayout;

import java.util.Arrays;

public class RedDotStyleBuild {
    private boolean enableRedDot;
    private int redDotSize;
    private int textSizeUnit = TypedValue.COMPLEX_UNIT_SP;
    private float textSize = 12;
    @ColorInt
    private int textColor = 0;
    @ColorInt
    private int backgroundResourceColor = 0;
    private Typeface typeface = null;
    private int gravity = Gravity.CENTER;
    private int[] padding = null;

    private int borderSize = 0;
    @ColorInt
    private int borderColor = 0;
    private int shadowRadius = 0;
    @ColorInt
    private int shadowColor = 0;
    private int shadowOffsetX = 0;
    private int shadowOffsetY = 0;
    @RedDotLayout.ShowPlace
    private int showPlace = RedDotLayout.ShowPlace.RIGHT_TOP;
    private boolean enableAutoMinSize = true;

    public RedDotStyleBuild() { }

    public void init(RedDotStyleBuild build) {
        this.enableRedDot = build.enableRedDot;
        this.redDotSize = build.redDotSize;
        this.textSizeUnit = build.textSizeUnit;
        this.textSize = build.textSize;
        this.textColor = build.textColor;
        this.backgroundResourceColor = build.backgroundResourceColor;
        this.typeface = build.typeface;
        this.gravity = build.gravity;
        this.padding = build.padding;
        this.borderSize = build.borderSize;
        this.borderColor = build.borderColor;
        this.shadowRadius = build.shadowRadius;
        this.shadowColor = build.shadowColor;
        this.shadowOffsetX = build.shadowOffsetX;
        this.shadowOffsetY = build.shadowOffsetY;
        this.showPlace = build.showPlace;
        this.enableAutoMinSize = enableAutoMinSize;
    }

    @NonNull
    @Override
    public String toString() {
        return "RedDotStyleBuild{" +
                "enableRedDot=" + enableRedDot +
                ", redDotSize=" + redDotSize +
                ", textSizeUnit=" + textSizeUnit +
                ", textSize=" + textSize +
                ", textColor=" + textColor +
                ", backgroundResourceColor=" + backgroundResourceColor +
                ", typeface=" + typeface +
                ", gravity=" + gravity +
                ", padding=" + Arrays.toString(padding) +
                ", borderSize=" + borderSize +
                ", shadowRadius=" + shadowRadius +
                ", shadowOffsetX=" + shadowOffsetX +
                ", shadowOffsetY=" + shadowOffsetY +
                ", borderColor=" + borderColor +
                ", shadowColor=" + shadowColor +
                ", showPlace=" + showPlace +
                ", enableAutoMinSize=" + enableAutoMinSize +
                '}';
    }

    public boolean isEnableRedDot() { return enableRedDot; }
    public RedDotStyleBuild setEnableRedDot(boolean enable) {
        enableRedDot = enable;
        return this;
    }

    public int getRedDotSize() { return redDotSize; }
    public RedDotStyleBuild setRedDotSize(int size) {
        redDotSize = size;
        return this;
    }

    public int getTextSizeUnit() { return this.textSizeUnit; }
    public RedDotStyleBuild setTextSizeUnit(int textSizeUnit) {
        this.textSizeUnit = textSizeUnit;
        return this;
    }

    public float getTextSize() { return this.textSize; }
    public RedDotStyleBuild setTextSize(float textSize) {
        this.textSize = textSize;
        return this;
    }

    @ColorInt
    public int getTextColor() {
        return this.textColor;
    }

    public RedDotStyleBuild setTextColor(@ColorInt int textColor) {
        this.textColor = textColor;
        return this;
    }

    @ColorInt
    public int getBackgroundResourceColor() {
        return backgroundResourceColor;
    }

    public RedDotStyleBuild setBackgroundResourceColor(@ColorInt int backgroundResourceColor) {
        this.backgroundResourceColor = backgroundResourceColor;
        return this;
    }

    public Typeface getTypeface() {
        return this.typeface;
    }

    public RedDotStyleBuild setTypeface(Typeface typeface) {
        this.typeface = typeface;
        return this;
    }

    public int getGravity() {
        return this.gravity;
    }

    public RedDotStyleBuild setGravity(int gravity) {
        this.gravity = gravity;
        return this;
    }

    public int[] getPadding() { return this.padding; }
    public RedDotStyleBuild setPadding(int[] padding) {
        this.padding = padding;
        return this;
    }
    public RedDotStyleBuild setPadding(int left, int top, int right, int bottom) {
        return setPadding( new int[] { left, top, right, bottom } );
    }

    public int getBorderSize() { return borderSize; }
    public RedDotStyleBuild setBorderSize(int borderSize) {
        this.borderSize = borderSize;
        return this;
    }

    public int getShadowRadius() { return shadowRadius; }
    public RedDotStyleBuild setShadowRadius(int shadowRadius) {
        this.shadowRadius = shadowRadius;
        return this;
    }

    public int getShadowOffsetX() { return shadowOffsetX; }
    public RedDotStyleBuild setShadowOffsetX(int shadowOffsetX) {
        this.shadowOffsetX = shadowOffsetX;
        return this;
    }

    public int getShadowOffsetY() { return shadowOffsetY; }
    public RedDotStyleBuild setShadowOffsetY(int shadowOffsetY) {
        this.shadowOffsetY = shadowOffsetY;
        return this;
    }

    public int getBorderColor() { return borderColor; }
    public RedDotStyleBuild setBorderColor(int borderColor) {
        this.borderColor = borderColor;
        return this;
    }

    public int getShadowColor() { return shadowColor; }
    public RedDotStyleBuild setShadowColor(int shadowColor) {
        this.shadowColor = shadowColor;
        return this;
    }

    public int getShowPlace() { return showPlace; }
    public RedDotStyleBuild setShowPlace(int showPlace) {
        this.showPlace = showPlace;
        return this;
    }

    public boolean isEnableAutoMinSize() { return enableAutoMinSize; }
    public RedDotStyleBuild setEnableAutoMinSize(boolean enableAutoMinSize) {
        this.enableAutoMinSize = enableAutoMinSize;
        return this;
    }
}
